<%--
  Created by IntelliJ IDEA.
  User: oler
  Date: 20.05.14
  Time: 15:42
  To change this template use File | Settings | File Templates.
--%>

<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>

<%@ include file="urls.jsp" %>

<c:set var="lang" value="${pageContext.response.locale}"/>

<html>
<head>
    <meta charset="utf-8">

    <script type="text/javascript" src="${jQueryUrl}"></script>
    <script src="${jsLocalChangeUrl}"></script>

    <title></title>

</head>
<body>

<%@ include file="header.jsp" %>

<form action="${loginUrl}" method="post" id="authentificateForm">
    <table align="center">
        <tr style="text-align: center;">
            <td colspan="2">
                <h2><spring:message code="login.caption"/></h2>
            </td>
        </tr>
        <tr style="text-align: center;">
            <td colspan="2">
                <h3><spring:message code="login.prompt"/></h3>
            </td>
        </tr>
        <tr>
            <td style="text-align: right;">
                <spring:message code="login.login"/>
            </td>
            <td style="text-align: left;">
                <input type="text" id="login" name="login" maxlength="20" required>
            </td>
        </tr>
        <tr style="text-align: center;">
            <td style="text-align: right;">
                <spring:message code="login.password"/>
            </td>
            <td style="text-align: left;">
                <input type="password" id="psw" name="password" maxlength="20" required>
            </td>
        </tr>
        <tr style="text-align: center;">
            <td colspan="2">
                <input type="checkbox" name="_spring_security_remember_me"/>
                <spring:message code='login.rememberme'/>
            </td>
        </tr>
        <tr style="text-align: center;">
            <td colspan="2">
                <input type="submit" value="<spring:message code='login.submit'/>" id="call"/>
            </td>
        </tr>
        <tr style="text-align: center;">
            <td colspan="2">
                <br/>

                <div id="output">
                    <c:if test="${not empty error}">
                        ${error}
                        <%--${sessionScope["SPRING_SECURITY_LAST_EXCEPTION"].message}--%>
                        ${sessionScope["SPRING_SECURITY_LAST_USERNAME"]}
                    </c:if>
                    <c:if test="${not empty msg}">
                        ${msg}
                    </c:if>
                </div>
            </td>
        </tr>
    </table>
    <input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
</form>
</body>
</html>